$(function(){
    $('#del').on('click', function() {
    	 var ids="";
		 var li=$("ul").find(".active");//获得所有被选中的li
		li.each(function(){
			 var qid=$(this).find(":checkbox").val();
			 ids+=qid+",";
			
		});
		if(ids!==""){
			 var diag = new $.Zebra_Dialog({
		            source:  {'ajax': '/questions/deleteAlert.html'},
		            width:300,
		            title:'提示',
		            'buttons' : [ {
						caption : '确定',
						callback : function() {
							$.ajax({
					    		url: '/examReport/delExaminationOnTheSpot',
					    		type: 'post',
					    		async:false,
					    		cache:false,
					    		data: {"ids": ids},
					    		success: function (data) {
					    	            $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">删除成功！</div></div>', {
					    	                'title': '提示',
					    	                'buttons' : [ {
					    						caption : '确定',
					    						callback : function() {window.location.href="/examReport/examinationOnTheSpot";}} ]
					    	            });
					    	            }
					    		});
						}},{
							caption : '取消',
							callback : function() {
								window.location.href="/examReport/examinationOnTheSpot";
							}
					} ]
		        }); 
			
		}else{
			zebra_Dialog_warning("请选择数据!");
		}
    	
    });
    
    $('#modify').on('click', function() {
		 
		 var li=$("ul").find(".active");//获得所有被选中的li
		 if(li.length===1){
			 var qid=li.find(":checkbox").val();
			 window.location.href="/examReport/editExaminationOnTheSpot?id="+qid;
			 
		 }else{
			 zebra_Dialog_warning("请选择一条数据!");
		 }
		
	    });
    
});
